<?php defined('IN_ADMIN') or exit('No permission resources.');?>
<?php include $this->admin_tpl('header', 'admin');?>
<script type="text/javascript" src="<?php echo JS_PATH?>jquery.sgallery.js"></script>
<div class="pad-lr-10">
<form name="searchform" action="" method="get">
		<input type="hidden" value="talent" name="m"> 
		<input type="hidden" value="manage" name="c"> 
		<input type="hidden" value="init" name="a">
		<input type="hidden" value="<?php echo $_GET['talent_type']?>" name="talent_type">
		<table width="100%" cellspacing="0" class="search-form">
			<tbody>
				<tr>
					<td>
						<div class="explain-col">
							<select name="key">
								<option value="1">真实姓名</option>
								<option value="2">手机号</option>
								<option value="3">身份证号</option>
							</select>
							<input name="keyword" class="input-text" value="<?php echo $_GET['keyword']?>" type="text" size="20">
							<?php echo L('address')?>:
							<input name="address" class="input-text" value="<?php echo $_GET['address']?>" type="text" size="20"> 
							&nbsp;来源：<?php echo form::select(array('1'=>'站内录入','2'=>'认证导入','3'=>'少儿报名导入','4'=>'新丝路旧网站数据'),$source,'name="source"','请选择')?>
							<input type="submit" value="<?php echo L('search')?>" class="button" name="dosubmit">
						</div>
					</td>
				</tr>
			</tbody>
		</table>
	</form>
<form name="myform" action="?m=talent&c=manage&a=del&talent_type=<?php echo $_GET['talent_type']?>" method="post" onsubmit="return confirm('<?php echo L('confirm')?>')">
<div class="table-list">
<table width="100%" cellspacing="0">
	<thead>
		<tr>
			<th  align="center" width="20"><input type="checkbox" value="" id="check_box" onclick="selectall('id[]');"></th>
			<th align="center">ID</th>
			<th align="center"><?php echo L('moter_realname')?></th>
			<th align="center"><?php echo L('moter_nickname')?></th>
			<th align="center"><?php echo L('moter_enname')?></th>
			<th align="center"><?php echo L('moter_gender')?></th>
			<th align="center"><?php echo L('image_square')?></th>
			<th align="center">APP端展示</th>
			<th align="center"><?php echo L('author')?></th>
			<th align="center"><?php echo L('time')?></th>
			<th align="center" width='180px'><?php echo L('operation')?></th>
		</tr>
	</thead>
<tbody>
<?php
if(!empty($talent_info)){
	foreach($talent_info as $k=>$v) {
?>
    <tr>
		<td align="center"><input type="checkbox" value="<?php echo $v['id']?>" name="id[]"></td>
		<td align="center"><?php echo $v['id']?></td>
		<td align="center"><?php echo $v['real_name']?></td>
		<td align="center"><?php if(!empty($v['nickname'])){echo $v['nickname'];}else{echo '<font color="red">（未设置）</font>';};?></td>
		<td align="center"><?php if(!empty($v['en_name'])){echo $v['en_name'];}else{echo '<font color="red">（未设置）</font>';}?></td>
		<td align="center"><?php if($v['gender'] == '1'){echo '男';}elseif($v['gender'] == '2'){echo '女';}elseif($v['gender'] == '3'){echo '保密';}?></td>
		<td align="center"><?php if(!empty($v['image_square'])){echo '<img src="'.$v['image_square'].'" height="80px">';}else{echo '<font color="red">（未设置）</font>';}?></td>
		<td align="center">
				<a href="javascript:;" onclick="change_app_display(this)" title="点击改变状态" data-id="<?php echo $v['id']?>" data-status="<?php echo $v['is_display_app']?>"><?php if($v['is_display_app']==0){echo '<font color="red">否</font>';}elseif($v['is_display_app']==1){echo '<font color="green">是</font>';}?></a>
		</td>
		<td align="center"><?php echo $v['username']?></td>
		<td align="center"><?php if(!empty($v['update_time'])){echo str_cut($v['update_time'],15,'');}else{echo '<font color="red">（未设置）</font>';}?></td>
		<td align="center">
		<a href="?m=talent&c=manage&a=detail&id=<?php echo $v['id']?>&talent_type=<?php echo $_GET['talent_type']?>"><?php echo L('detail');?></a>&nbsp;|&nbsp;
		<a href="?m=talent&c=manage&a=edit&id=<?php echo $v['id']?>&talent_type=<?php echo $_GET['talent_type']?>&menuid=<?php echo $_GET['menuid']?>"><?php echo L('edit');?></a>&nbsp;|&nbsp;
		<a href="?m=talent&c=manage&a=del&id=<?php echo $v['id']?>&talent_type=<?php echo $_GET['talent_type']?>&menuid=<?php echo $_GET['menuid']?>" onClick="return confirm('<?php echo L('confirm')?>')"><?php echo L('del')?></a>&nbsp;|&nbsp;
		<a href="?m=resource_asso&c=manage&a=moter_record&talent_id=<?php echo $v['id']?>&source_type=4&talent_type=<?php echo $_GET['talent_type']?>&menuid=<?php echo $_GET['menuid']?>"><?php echo L('resource_asso')?></a>
		 </td>
    </tr>
<?php
	}
}else{
?>
	<tr><td colspan='10' style='color:red;font-size:18px;text-align:center;'><span>暂无数据！</span></td></tr>
<?php }?>
</tbody>
</table>

<div class="btn">
<label for="check_box"><a href="#" onClick="javascript:$('input[type=checkbox]').attr('checked', true)"><?php echo L('select_all')?></a>/<a href="#" onClick="javascript:$('input[type=checkbox]').attr('checked', false)"><?php echo L('cancel')?></a></label> <input type="submit" class="button" name="dosubmit" value="<?php echo L('delete')?>"/>
</div>

<div id="pages"><?php echo $pages?></div>
</div>
</form>
</div>
<script type="text/javascript">
<!--
function change_app_display(obj){
	var id=$(obj).attr("data-id");
	var status=$(obj).attr("data-status");
	//status为现在状态
	var msg="";
	if(status==1){
		status=0;
		msg="<font color='red'>否</font>";

	}else{
		status=1;
		msg="<font color='green'>是</font>";
	}
	$.ajax({
		type:"POST",
		url:"?m=talent&c=manage&a=change_app_status&pc_hash=<?php echo $_SESSION['pc_hash']?>",
		data:{"id":id,"status":status},
		dataType:"JSON",
		success:function(result){
			if(result.status==200){
				$(obj).html(msg);
			    $(obj).attr("data-status",status);
			} else {
				alert(result.info);
				return false;
			}
		}
	});
}
//-->
</script>
</body>
</html>